package com.example.lynandroid.views

import android.annotation.SuppressLint
import android.content.Context
import android.util.AttributeSet
import android.view.KeyEvent
import android.view.MotionEvent
import android.view.inputmethod.EditorInfo
import android.view.inputmethod.InputConnection
import androidx.appcompat.widget.AppCompatEditText
import com.example.lynandroid.log

@SuppressLint("ClickableViewAccessibility")
class DreamEdit(context: Context, attributeSet: AttributeSet) :
    AppCompatEditText(context, attributeSet) {

    init {
        setOnFocusChangeListener { _, _ ->
            log("onFocusChange")
        }
    }

    override fun onKeyUp(keyCode: Int, event: KeyEvent?): Boolean {
        log("onKeyUp")
        return super.onKeyUp(keyCode, event)
    }

    override fun onKeyLongPress(keyCode: Int, event: KeyEvent?): Boolean {
        log("onKeyLongPress")
        return super.onKeyLongPress(keyCode, event)
    }

    override fun onKeyMultiple(keyCode: Int, repeatCount: Int, event: KeyEvent?): Boolean {
        log("onKeyMultiple")
        return super.onKeyMultiple(keyCode, repeatCount, event)
    }

    override fun onKeyDown(keyCode: Int, event: KeyEvent?): Boolean {
        log("onKeyDown")
        return super.onKeyDown(keyCode, event)
    }
}